package HLLibClasses;

import HLCode.HLClassManager;
import HLCode.HLLibClass;
import HLCode.HLObject;
import HLLib.base.HLByteList;
import HLLib.base.HLString;
import HLLib.io.HLFile;

public class HLClassFile extends HLLibClass {
    public HLClassFile(HLClassManager owner) {
        super(owner);
    }

    public HLObject NewObject() {
        return new HLFile();
    }

    public void Execute(HLObject self, int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            ((HLFile) self).CreateByLength(args.GetInt(0));
            break;
        }
        case 1: {
            if (resultOwnerObject == null) {
                ((HLFile) self).Length();
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLFile) self).Length());
            }
            break;
        }
        case 2: {
            if (resultOwnerObject == null) {
                ((HLFile) self).Load((HLString)args.GetObject(0));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLFile) self).Load((HLString)args.GetObject(0)));
            }
            break;
        }
        case 3: {
            if (resultOwnerObject == null) {
                ((HLFile) self).LoadFromLocal((HLString)args.GetObject(0));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLFile) self).LoadFromLocal((HLString)args.GetObject(0)));
            }
            break;
        }
        case 4: {
            if (resultOwnerObject == null) {
                ((HLFile) self).LoadFromNet((HLString)args.GetObject(0));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLFile) self).LoadFromNet((HLString)args.GetObject(0)));
            }
            break;
        }
        case 5: {
            if (resultOwnerObject == null) {
                ((HLFile) self).LoadFromRms((HLString)args.GetObject(0));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLFile) self).LoadFromRms((HLString)args.GetObject(0)));
            }
            break;
        }
        case 6: {
            ((HLFile) self).Update((HLString)args.GetObject(0));
            break;
        }
        case 7: {
            ((HLFile) self).Save((HLString)args.GetObject(0));
            break;
        }
        case 8: {
            if (resultOwnerObject == null) {
                ((HLFile) self).ReadInt8();
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLFile) self).ReadInt8());
            }
            break;
        }
        case 9: {
            if (resultOwnerObject == null) {
                ((HLFile) self).ReadUInt8();
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLFile) self).ReadUInt8());
            }
            break;
        }
        case 10: {
            if (resultOwnerObject == null) {
                ((HLFile) self).ReadInt16();
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLFile) self).ReadInt16());
            }
            break;
        }
        case 11: {
            if (resultOwnerObject == null) {
                ((HLFile) self).ReadUInt16();
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLFile) self).ReadUInt16());
            }
            break;
        }
        case 12: {
            if (resultOwnerObject == null) {
                ((HLFile) self).ReadInt();
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLFile) self).ReadInt());
            }
            break;
        }
        case 13: {
            if (resultOwnerObject == null) {
                ((HLFile) self).ReadByteList(args.GetInt(0));
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLFile) self).ReadByteList(args.GetInt(0)));
            }
            break;
        }
        case 14: {
            if (resultOwnerObject == null) {
                ((HLFile) self).ReadIntByByteCount(args.GetInt(0));
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLFile) self).ReadIntByByteCount(args.GetInt(0)));
            }
            break;
        }
        case 15: {
            if (resultOwnerObject == null) {
                ((HLFile) self).ReadUIntByByteCount(args.GetInt(0));
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLFile) self).ReadUIntByByteCount(args.GetInt(0)));
            }
            break;
        }
        case 16: {
            if (resultOwnerObject == null) {
                ((HLFile) self).ReadString();
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLFile) self).ReadString());
            }
            break;
        }
        case 17: {
            if (resultOwnerObject == null) {
                ((HLFile) self).ReadLongString();
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLFile) self).ReadLongString());
            }
            break;
        }
        case 18: {
            ((HLFile) self).WriteInt8(args.GetInt(0));
            break;
        }
        case 19: {
            ((HLFile) self).WriteUInt8(args.GetInt(0));
            break;
        }
        case 20: {
            ((HLFile) self).WriteInt16(args.GetInt(0));
            break;
        }
        case 21: {
            ((HLFile) self).WriteUInt16(args.GetInt(0));
            break;
        }
        case 22: {
            ((HLFile) self).WriteInt(args.GetInt(0));
            break;
        }
        case 23: {
            ((HLFile) self).WriteByteList((HLByteList)args.GetObject(0));
            break;
        }
        case 24: {
            ((HLFile) self).WriteString((HLString)args.GetObject(0));
            break;
        }
        case 25: {
            ((HLFile) self).WriteLongString((HLString)args.GetObject(0));
            break;
        }
        case 26: {
            if (resultOwnerObject == null) {
                ((HLFile) self).GetData();
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLFile) self).GetData());
            }
            break;
        }
        case 27: {
            ((HLFile) self).SetData((HLByteList)args.GetObject(0));
            break;
        }
        }
    }

    public void StaticExecute(int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            if (resultOwnerObject == null) {
                HLFile.Exists((HLString)args.GetObject(0));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, HLFile.Exists((HLString)args.GetObject(0)));
            }
            break;
        }
        case 1: {
            HLFile.Delete((HLString)args.GetObject(0));
            break;
        }
        }
    }
}
